import random

ran = random.randint(0, 10)
print('猜数字游戏')
while True:
    guess = eval(input('请输入猜测数字'))
    if guess < ran:
        print('小了')
    elif guess > ran:
        print('大了')
    else:
        print('对了')
        # break 跳出循环
        break
 